<?php
// Luu dieu kien loc theo linh vuc 
$v_current_item_id = '';
if(isset($_REQUEST['hdn_current_item_id'])){
	$v_current_item_id = $_REQUEST['hdn_current_item_id'];
}
if ($v_receive_date !=""){
	$v_receive_date_filter = $v_receive_date;
}else{
	$v_receive_date_filter = "";
}
if(isset($_REQUEST['hdn_received_date_filter'])){
	$v_receive_date_filter = $_REQUEST['hdn_received_date_filter'];
} 
$v_recordtype_filter = $_SESSION['onegate_current_recordtype'];
$v_citizen_username = "";
if (isset($_SESSION['citizen_username']) && !is_null(($_SESSION['citizen_username']))){
	$v_citizen_username = $_SESSION['citizen_username'];
}
/*
switch($_ISA_CURRENT_MODUL_CODE) {
	case "HANDLE";
		$v_role = "THU_LY";
		break;
	default:
		$v_role = "";
		break;
}
if ($v_is_granted_view_record){
	$v_role = "";
}
*/
$v_order_clause = " ORDER BY C_CITIZEN_NAME";

if(_is_sqlserver()){
	$sql = "Exec Onegate_CustomerRecordGetAll";
	$sql = $sql . " '" . $v_citizen_username . "'" ;
	$sql = $sql . ",'" . $v_recordtype_filter . "'" ;
	$sql = $sql . ",'" ._ddmmyyyy_to_yyyymmdd($v_receive_date_filter) . "'" ;
	$sql = $sql . ",'" . $v_status_list."'" ;
	$sql = $sql . ",'" . $v_order_clause."'" ;
	//echo $sql; //exit;
	$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
	$arr_all_record = $ado_conn->GetAll($sql);
}
?>